{extend name="index/iframe" /}

{block name="content"}
<form class="layui-form layui-form-my" action="" style="padding-right:10px;">
    <input type="hidden" value="{$Think.get.cps_id}" name="cps_id">
    <div class="layui-form-item">
        <label class="layui-form-label">渠道名称</label>
        <div class="layui-input-block">
            <div style="line-height:36px;">
                {$Think.get.cps_id}：{$Think.get.cps_name}
            </div>
        </div>
    </div>
    {volist name="select" id="vo"}
    <div class="layui-form-item">
        <label class="layui-form-label">{$vo.type}</label>
        <div class="layui-input-block">
            <input type="text" name="give_num[{$vo.id}]" value="{$vo.give_num}" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    {/volist}

    <div class="layui-form-item" style="margin-bottom: 100px;">
        <div class="layui-input-block">
            <button class="layui-btn my-btn" lay-submit="" lay-filter="submitBtn">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}

{block name="css"}
{/block}

{block name="js"}
<script>
    layui.use(['form', 'element'], function(){
        var form = layui.form
            ,$ = layui.$
            ,layer = layui.layer;


        //提交
        form.on('submit(submitBtn)', function(data){
            var load = layer.load();
            $.post('{:url("ChannelAccount/limit")}',data.field, function(json){
                layer.close(load);
                json.code==0 ? layer.msg(json.msg, {icon: 1, time: 1000}) : layer.msg(json.msg, {icon: 0, time: 1000});
            }, 'JSON').error(function(){
                layer.close(load);
                layer.msg('连接超时，请联系后台管理员', {icon: 2, time:3000});
            });
            return false;
        });
    });
</script>
{/block}